package org.codefinger.json.parser.deserializer;

import org.codefinger.json.parser.JSONArrayDeserializer;
import org.codefinger.json.parser.JSONDeserializer;
import org.codefinger.json.parser.JSONLexer;
import org.codefinger.json.parser.JSONObjectDeserializer;

public class DeserializerForCharArray implements JSONDeserializer {

	public static final DeserializerForCharArray	INSTANCE	= new DeserializerForCharArray();

	private DeserializerForCharArray() {

	}

	
	@Override
	public Object stringValue(String value) {
		return  value.toCharArray();
	}

	
	@Override
	public Object stringValue(JSONLexer jsonLexer) {
		return  jsonLexer.getJSONString().toCharArray();
	}

	
	@Override
	public Object intValue(String value) {
		return  value.toCharArray();
	}

	
	@Override
	public Object floatValue(String value) {
		return  value.toCharArray();
	}

	
	@Override
	public Object falseValue() {
		return  new char[] { 'f', 'a', 'l', 's', 'e' };
	}

	
	@Override
	public Object trueValue() {
		return  new char[] { 't', 'r', 'u', 'e' };
	}

	@Override
	public JSONArrayDeserializer createArrayDeserializer() {
		return new ArrayDeserializerForCharArray();
	}

	@Override
	public JSONObjectDeserializer createObjectDeserializer() {
		return ObjectDeserializerForNull.INSTANCE;
	}

}
